﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarHelpDesk.Web.Models.Repositories
{
    public interface IQuestionVotesRepository
    {
        /// <summary>
        /// Gets user's vote for question.
        /// </summary>
        /// <param name="questionID">The questionID.</param>
        /// <param name="userID">The userID.</param>
        /// <param name="vote">The result - null if method returnes false.</param>
        /// <returns>true if the user has voted for the question, else false</returns>
        bool GetVote(int questionID, Guid userID, out QuestionVote vote);


        /// <summary>
        /// Creates vote for vote.
        /// </summary>
        /// <param name="vote">The vote.</param>
        void CreateVote(QuestionVote vote);

        /// <summary>
        /// Updates vote for questions.
        /// </summary>
        /// <param name="vote">The vote.</param>
        void UpdateVote(QuestionVote vote);

        /// <summary>
        /// Gets all votes of the user.
        /// </summary>
        /// <param name="userID">The userID.</param>
        /// <returns></returns>
        IQueryable<QuestionVote> GetAllUserVotes(Guid userID);

        /// <summary>
        /// Gets all votes for the question.
        /// </summary>
        /// <param name="questionID">The questionID.</param>
        /// <returns></returns>
        IQueryable<QuestionVote> GetAllQuestionsVotes(int questionID);
    }
}
